无法保存,数据库操作出错:[Microsoft][ODBC Microsoft Access Driver] 操作必须使用一个可更新的查询。

来源:百度知道 编辑:UC知道 时间:2024/07/06 23:46:46
<%
dim curaction, curid, bedit, founderr, errmsg,newsimagesyesno
newsimagesyesno="no"
newsimagesyesno=request("newsimagesyesno")
curaction = request("action")
curid = request("id")
bedit = false
founderr = false

if curaction = "edit" then
bedit = true
end if

dim sql
'删除记录
if curaction = "delete" then
sql = "DELETE FROM news WHERE id=" + cstr(curid)
conn.execute sql
if err.number <> 0 then
response.write "无法删除,数据库操作出错:" + err.description
err.clear
else
response.write "<table><tr><td><p>·删除成功</p></td></tr></table>"
end if
end if

'添加记录
if curaction = "newsave" then
if trim(request("name")) = "" then
founderr = true
errmsg = "<tabl

好像是access驱动的问题
以你现在的情况看来你的数据库的驱动不支持insert和update
你可以尝试换一个数据库驱动
或者用rs.addnew和ra.updata来添加纪录,只不过这样效率会大打折扣。